<form class="layui-form resViewForm" action="" lay-filter="resViewForm" style="padding-right: 10px;" >
    <div class="layui-form-item">
        <label class="layui-form-label">资源名称：</label>
        <div class="layui-input-block">
            <input type="text" name="resName" class="layui-input alias" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">资源别名:</label>
        <div class="layui-input-block" >
            <input type="text" name="alias" class="layui-input" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">资源图标:</label>
        <div class="layui-input-block">
            <i class="" id="iconShowView" style="margin: 9px;display: inline-block"></i>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">默认地址:</label>
        <div class="layui-input-block" >
            <input type="text" class="layui-input" name="defaultUrl" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否有子节点:</label>
        <div class="layui-input-block" >
            <input type="text" class="layui-input" name="isFolder" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">显示到菜单:</label>
        <div class="layui-input-block" >
            <input type="text" class="layui-input" name="isDisplayInMenu" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">默认打开:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="isOpen" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否打开新窗口:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="isNewOpen" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">同级排序:</label>
        <div class="layui-input-block">
            <input type="text" name="sn" class="layui-input" readonly>
        </div>
    </div>
</form>
<script>
    layui.use([ 'form', 'setter','commons'], function() {
        var form = layui.form,setter = layui.setter,commons = layui.commons;
        $.ajax({
            url: serverPath.systemPath + setter.sysLinkPath + "sysRes/get",
            type: "get",
            dataType: 'json',
            data: {
                resId:$('#resIdSelect').val()
            },
            success: function (data) {
                var returnDate = data.data;
                form.val('resViewForm', {
                    "resName": returnDate.resName,// "name": "value"
                    "alias": returnDate.alias,//复选框选中状态
                    "isFolder": returnDate.isFolder==1?"是":"否",
                    "defaultUrl": returnDate.defaultUrl,
                    "isDisplayInMenu": returnDate.isDisplayInMenu==1?"是":"否",
                    "isOpen": returnDate.isOpen==1?"是":"否",
                    "isNewOpen": returnDate.isNewOpen==1?"是":"否",
                    "official": returnDate.creator==999999999?"是":"否",
                    "sn": returnDate.sn+"",
                    "parentId": returnDate.parentId+"",
                    "roleType": returnDate.roleType+""
                });
                $('#iconShowView').addClass(returnDate.iconSkin);
            }
        });
    })
</script>
<style>
    /* sysRes/view */
    .resViewForm .layui-form-label{
        width:150px;
    }
    .resViewForm .layui-input-block{
        margin-left: 190px;
    }
</style>